
require('../css/commCss/normalize.css')
require('../css/commCss/reset.css')
require('../css/commCss/property.css')
require('../css/commCss/basic.css')
require('../libs/iconfont/iconfont.css')
require('../css/circleTrends.less')

const Move = require('../libs/move/slide.fn')

document.addEventListener('DOMContentLoaded', function () {
  
    let switchBox = document.querySelector('.switch')
    let back = document.querySelector('.back')
    let point = document.querySelector('.point')
    // 实现开关按钮
    function Switch(){
        let flag = true;
        switchBox.addEventListener('click',function(){
            if(flag){
                switchBox.style.backgroundColor = 'rgba(0, 226, 102)'
                Move.startMove(point,{top:2,left:21},200,'easeIn')
            }else{
                switchBox.style.backgroundColor = '#e2e2e3'
                Move.startMove(point,{top:2,left:3},200,'easeIn')

            }
            flag = !flag
        })
    }
    Switch();
    
    //点击×返回上一页
    back.addEventListener('click',function(){
        history.go(-1)
    })

})